//
// Created by ta&to on 2022/9/28.
//

#ifndef TCPSERVER_TCP_CONNECT_H
#define TCPSERVER_TCP_CONNECT_H
#define MAXCLINE 5 //连接队列中的个数

// 切换IO模型
#ifndef SOCKET_SERVER_SELECT
#define SOCKET_SERVER_SELECT 1
#endif
#if !defined(SOCKET_SERVER_SELECT) && !defined(SOCKET_SERVER_POLL)
#define SOCKET_SERVER_POLL 1
#endif
#if !defined(SOCKET_SERVER_SELECT) && !defined(SOCKET_SERVER_POLL) && !defined(SOCKET_SERVER_EPOLL)
#define SOCKET_SERVER_EPOLL 1
#endif
#define TCPSERVER_OPEN 1 // 启用tcp 服务

#include "tcp_socket.h"

void init_conn(log_t *logt, int listen_port, int outtime_sec, void* socket_func, void* tcp_func);
int Select(log_t *logt, struct tcp_socket_event_loop_s *hset);
int Poll(log_t *logt, struct tcp_socket_event_loop_s *hset);
int Epoll(log_t *logt, struct tcp_socket_event_loop_s *hset);

void Close_Client(log_t *logt, struct tcp_socket_event_loop_s *hset, int n);
void Close_link(log_t *logt, struct tcp_socket_event_loop_s *hset, int n);
#endif //TCPSERVER_TCP_CONNECT_H
